home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / POV368KNot / POV368kNot.c next >
Encoding:
C/C++ Source or Header  |  1995-06-18  |  1.6 KB  |  72 lines  |  [TEXT/CWIE]

  1. // ----------------------------------------------------------------------
  2. // POV368KNot.c - Very simple application to display a dialog box & quit.
  3. // This is specifically for adding to a PowerMac application, in case
  4. // somebody tries to run it on a 68K Macintosh.  Instead of getting the
  5. // cryptic "No resource found" error message, this will give a human-readable
  6. // error and quit.
  7. // Written by: Eduard Schwan
  8. // ----------------------------------------------------------------------
  9.  
  10.  
  11. #include <Types.h>
  12. #include <Memory.h>
  13. #include <Quickdraw.h>
  14. #include <Fonts.h>
  15. #include <Events.h>
  16. #include <Menus.h>
  17. #include <Windows.h>
  18. #include <TextEdit.h>
  19. #include <Resources.h>
  20. #include <Dialogs.h>
  21. #include <OSUtils.h>
  22. #include <ToolUtils.h>
  23.  
  24.     
  25. // ----------------------------------------------------------------------
  26. static void Initialize(void)
  27. {
  28.     /* Initialize all the needed managers. */
  29.     InitGraf(&qd.thePort);
  30.     InitFonts();
  31.     InitWindows();
  32.     InitMenus();
  33.     TEInit();
  34.     InitDialogs(0L);
  35.     InitCursor();
  36.  
  37. }
  38.  
  39.  
  40. // ----------------------------------------------------------------------
  41. static void DarkSideOfTheMoon()
  42. {
  43.     OSErr        anError;
  44.     short        itemHit;
  45.     WindowPtr    myDialog;
  46.     SysEnvRec    theWorld;
  47.  
  48.     anError = SysEnvirons(1, &theWorld);
  49.     if (theWorld.systemVersion < 0x0700)
  50.     {
  51.     }
  52.     myDialog = GetNewDialog(6900, NULL, (WindowPtr)-1);
  53.     anError = ResError();
  54.     if (myDialog)
  55.         ShowWindow(myDialog);
  56.     // beep no matter what
  57.     SysBeep(1);
  58.     if (myDialog)
  59.         ModalDialog(NULL, &itemHit);
  60. }
  61.  
  62.  
  63. // ----------------------------------------------------------------------
  64. int main(void)
  65. {
  66.     Initialize();
  67.     
  68.     DarkSideOfTheMoon();
  69.     return 1;
  70. }
  71.  
  72.